﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlogDemo.Common
{
    /// <summary>
    /// 树型实体
    /// </summary>
    /// <typeparam name="TEntity">实体类型</typeparam>
    /// <typeparam name="TKey">实体标识类型</typeparam>
    /// <typeparam name="TParentId">父编号类型</typeparam>
    public interface ITreeEntity<TEntity, TKey, TParentId> : IEntity<TKey> where TEntity : ITreeEntity<TEntity, TKey, TParentId> where TKey : IComparable<TKey>
    {
        /// <summary>
        /// 父对象
        /// </summary>
        TEntity Parent { get; set; }
        /// <summary>
        /// 父编号
        /// </summary>
        TParentId ParentId { get; set; }

        string Path { get; set; }
        int Level { get; set; }
        /// <summary>
        /// 排序号
        /// </summary>
        int? SortId { get; set; }
    }
}
